<?php
// $Id:

/**
 * Preprocess function to build the isotope grid
 */
function template_preprocess_views_isotope(&$vars) {
  template_preprocess_views_view_list($vars);

  $view = $vars['view'];
  $options = $view->style_plugin->options;
  $handler = $view->style_plugin;
  $fields = &$view->field;
  $rows = &$vars['rows'];
  $vars['attributes'] = array();

  $vars['isotope_id'] = 'views-isotope-' . $view->name . '-' . $view->style_plugin->display->id;

  // Get stylesheets.
  drupal_add_css(drupal_get_path('module', 'views_isotope') . '/views_isotope.css');

  // Add JavaScript files and settings.
  drupal_add_js(libraries_get_path('jquery.isotope') . '/jquery.isotope.min.js');
  drupal_add_js(drupal_get_path('module', 'views_isotope') . '/views_isotope.js');

}

/**
 * Preprocess function to build isotope filter blocks
 */
function template_preprocess_views_isotope_filter_block(&$vars) {
  template_preprocess_views_view_list($vars);
  $view = $vars['view'];
  $options = $view->style_plugin->options;
  $handler = $view->style_plugin;
  $fields = &$view->field;
  $rows = &$vars['rows'];
  $vars['attributes'] = array();
}

/**
 * Preprocess function for isotope sort blocks
 */
function template_preprocess_views_isotope_sort_block(&$vars) {
  template_preprocess_views_view_list($vars);
  $view = $vars['view'];
  $options = $view->style_plugin->options;
  $handler = $view->style_plugin;
  $fields = &$view->field;
  $rows = &$vars['rows'];
  $vars['attributes'] = array();
}